package com.hzj.controller;


import com.hzj.service.CmnService;
import com.hzj.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/platformapi/cmn/dict/")
@CrossOrigin
public class CmnController {

    @Autowired
    private CmnService cmnService;

    @PostMapping("findByDictCode/{dictCode}")
    public Result findByDictCode(@PathVariable String dictCode){
        return cmnService.findByDictCode(dictCode);
    }

    @PostMapping("findByParentId/{parentId}")
    public Result findByParentId(@PathVariable int parentId){
        return cmnService.findChildData(parentId);
    }
}
